package org.crh.appointment.web;

import org.crh.appointment.AppointmentRecordService;
import org.crh.common.domain.AppointmentRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @author: RenHai Chen
 * @date: 2025/4/3 14:20
 */
@RestController
@RequestMapping("api")
public class AppointmentRecordController {
    @Autowired
    private AppointmentRecordService appointmentRecordService;

    @GetMapping("appointmentRecord/{recordNo}")
    AppointmentRecord getAppointmentRecordByRecordNo(@PathVariable("recordNo") String recordNo){
        return  appointmentRecordService.getRecord(recordNo);
    }

    @PostMapping("appointmentRecord/updateStatus")
    int updateStatus(@RequestBody AppointmentRecord appointmentRecord){
        return  appointmentRecordService.updateStatus(appointmentRecord);
    }
}
